Skip to content

feat(notifications): push + email for collaborative-track invite/accept#60

Merged
raymondjacobson merged 2 commits into
mainfrom
claude/collab-notifications
Jun 9, 2026
Merged

feat(notifications): push + email for collaborative-track invite/accept#60
raymondjacobson merged 2 commits into
mainfrom
claude/collab-notifications

Conversation

@raymondjacobson

Copy link
Copy Markdown
Member

Adds the notification content (push + email) for collaborative tracks, mirroring how manager mode works. Pairs with the api trigger (AudiusProject/api#932) that writes track_collaborator_invite / track_collaborator_accept rows to the notification table, and the apps client (AudiusProject/apps#14466).

Why this PR

The discovery trigger creates the notification rows, but the pedalboard/apps/notifications service is what turns them into push (mobile + browser) and email. Without a mapper per type, these notifications would have no delivered content. This mirrors requestManager / approveManagerRequest.

What's here

  • trackCollaboratorInvite mapper — notifies the invited collaborator: "<inviter> invited you to collaborate on <track>." (browser + mobile push; track title resolved via fetchEntities).
  • trackCollaboratorAccept mapper — notifies the inviter / track owner: "<collaborator> accepted your invitation to collaborate on <track>."
  • Both registered in mapNotifications.ts; data types added to types/notifications.ts.
  • Email digest body text + component cases for both types (so they also render in the daily/weekly digest, like manager mode). No new transactional email template was added — push is the focus, matching approveManagerRequest (push-only); a transactional invite email can follow if desired.
  • Mapper tests (__tests__/mappings/) asserting the push + browser payloads, inserting the notification row directly (so no dependency on the discovery trigger in the test DB).

Notification data shape (from the api trigger)

{ track_id, collaborator_user_id, inviter_user_id } — numeric ids (the service reads the raw DB row, not the hashid'd HTTP response).

Verification

App source typechecks clean (the only tsc errors in this checkout are a pre-existing @types/babel__traverse / tsc version skew, unrelated to these files). The mapper tests mirror the manager tests; CI provisions the discovery + identity test DBs.

🤖 Generated with Claude Code

raymondjacobson and others added 2 commits June 9, 2026 13:15
…te/accept

Mirrors the manager-mode notification mappers for collaborative tracks. The
api (discovery) trigger writes track_collaborator_invite / _accept rows to the
notification table; this adds the pedalboard content for them.

- trackCollaboratorInvite mapper: notifies the invited collaborator (browser +
  mobile push) — "<inviter> invited you to collaborate on <track>."
- trackCollaboratorAccept mapper: notifies the inviter/owner (browser + mobile
  push) — "<collaborator> accepted your invitation to collaborate on <track>."
- Registered both in mapNotifications; new data types in types/notifications.
- Email-digest body text + component for both types (push is the focus; both
  also render in the daily/weekly digest, mirroring manager mode).
- Mapper tests asserting the push + browser payloads.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
fetchEntities returns PlaylistInfo | TrackInfo; guard with 'title' in track
(as usdcPurchaseSeller does) so .title type-checks. Fixes the notifications
build (TS2339).
@raymondjacobson raymondjacobson merged commit 88642b2 into main Jun 9, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant